﻿using DDD.Core;
using DotNetCore.CAP;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;

namespace DDD.EFCore
{
    public class MySqlPublisherTransactionHandler(DotNetCore.CAP.ICapPublisher capPublisher) 
        : IPublisherTransactionHandler
    {
        public IDbContextTransaction BeginTransaction(DbContext context)
        {
            return context.Database.BeginTransaction(capPublisher,false);
        }
    }
}
